package com.example.nacosdemo.config;

import fpsp.hsm.client.UnionTssc;
import org.slf4j.Logger;
import org.slf4j.LoggerFactory;
import org.springframework.beans.factory.annotation.Value;
import org.springframework.context.annotation.Bean;
import org.springframework.context.annotation.Configuration;

@Configuration
public class HsmConfig {
    private Logger log = LoggerFactory.getLogger(this.getClass());

    @Value("${joyin.rzparam.configPath:/home/finance/etc/server.properties}")
    private String configPath;

    @Bean
    public UnionTssc getUnionTssc() throws Exception {
        log.info("加密机文件路径->{}",configPath);
        UnionTssc tssc = UnionTssc.getInstance(configPath);
        return tssc;
    }
}
